<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>EnvSet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>EnvSet</h1>

<p>Writes a value to a <a href="../Variables.htm">variable</a> contained in the  environment.</p>

<pre class="Syntax">EnvSet, EnvVar, Value</pre>
<h3>Parameters</h3>
<dl>

  <dt>EnvVar</dt>
  <dd>Name of the <a href="../Variables.htm#env">environment variable</a> to use, e.g. &quot;COMSPEC&quot;
      or &quot;PATH&quot;.</dd>

  <dt>Value</dt>
  <dd><p>Value to set the <a href="../Variables.htm#env">environment variable</a> to.</p></dd>

</dl>
<h3>ErrorLevel</h3>
<p><span class="ver">[v1.1.04+]</span> This command is able to throw an exception on failure. For more information, see <a href="Catch.htm#RuntimeErrors">Runtime Errors</a>.</p>
<p><a href="../misc/ErrorLevel.htm">ErrorLevel</a> is set to 1 if there was a problem or 0 otherwise.</p>
<h3>Remarks</h3>
<p>The operating system limits each environment variable to 32 KB of text.</p>
<p>An environment variable created or changed with this command will be accessible only to programs the script launches via <a href="Run.htm">Run</a> or <a href="Run.htm">RunWait</a>. See <a href="../Variables.htm#env">environment variables</a> for more details.</p>
<p>This command exists separately from <a href="SetEnv.htm">SetEnv</a> because <a href="../Variables.htm">normal script variables</a> are not stored in the environment. This is because performance would be worse and also because the OS limits environment variables to 32 KB.</p>
<h3>Related</h3>
<p><a href="EnvGet.htm">EnvGet</a>, <a href="_NoEnv.htm">#NoEnv</a>, <a href="../Variables.htm#env">environment variables</a>, <a href="EnvUpdate.htm">EnvUpdate</a>, <a href="SetEnv.htm">SetEnv</a>, <a href="Run.htm">Run</a>, <a href="Run.htm">RunWait</a></p>
<h3>Example</h3>
<pre class="NoIndent">EnvSet, AutGUI, Some text to put in the variable.</pre>

</body>
</html>
